﻿@using Cloud.Boss.Models;
@using Cloud.Framework.Model;
@{
    Layout = "~/Views/Shared/_Layout.cshtml";
    ViewBag.Title = "Home Page";
    var firstMenus = ViewBag.firstMenus as List<CurrentSysUserPermission>;
}

<!--导航栏-->
<div id="navbar" class="navbar navbar-default ace-save-state">
	<div class="navbar-container ace-save-state" id="navbar-container">
		<!--mobile展示菜单-->
		<button type="button" class="navbar-toggle menu-toggler pull-left" id="menu-toggler" data-target="#sidebar">
			<span class="sr-only">Toggle sidebar</span>
			<span class="icon-bar"></span>
			<span class="icon-bar"></span>
			<span class="icon-bar"></span>
		</button>
		<!--系统名称-->
		<div class="navbar-header pull-left">
			<a href="index.html" class="navbar-brand">
				<small>
					@*<i class="fa fa-leaf"></i>*@
					@ViewBag.siteName
				</small>
			</a>
		</div>

		@{
		int index = 0;
		if (firstMenus.Count > 1)
		{ <div class="navbar-header pull-left" style="margin-left:20px;">
				<span class="navbar-brand">
					@foreach (var menu in firstMenus)
				{
					index++;
					<small node-id="@menu.id" class="first-menu @(index==1?"active":"")">
						@menu.name
					</small>
			}
				</span>
			</div>
	}
	else
	{
		if (firstMenus.Count > 0)
		{
			<small node-id="@firstMenus[0].id" style="display:none;" class="first-menu active">
				@firstMenus[0].name
			</small>
	}

}
		}



		<!--用户设置-->
		<div class="navbar-buttons navbar-header pull-right" role="navigation">
			<ul class="nav ace-nav">
				<li class="light-blue dropdown-modal">
					<a data-toggle="dropdown" href="#" class="dropdown-toggle">
						<img class="nav-user-photo" src="/ace/images/avatars/user.jpg" alt="Jason's Photo" />
						<span class="user-info">
							<small>欢迎,</small>
							@ViewBag.name
						</span>

						<i class="ace-icon fa fa-caret-down"></i>
					</a>

					<ul class="user-menu dropdown-menu-right dropdown-menu dropdown-yellow dropdown-caret dropdown-close">
						@*<li >
							<a href="javascript:void(0)">
								<i class="ace-icon fa fa-cog"></i>
								设置
							</a>
						</li>*@
						<li class="popupEdit" title="修改密码" call-type="window" call-url="@Url.Action("ModifyPassword","Account")" callback-url="@Url.Action("Logout","Account")">
							<a href="javascript:void(0)">
								<i class="ace-icon fa fa-key"></i>
								修改密码
							</a>
						</li>
						@*<li>
							<a href="profile.html">
								<i class="ace-icon fa fa-user"></i>
								个人信息
							</a>
						</li>*@

						<li class="divider"></li>

						<li>
							<a href="/Account/Logout">
								<i class="ace-icon fa fa-power-off"></i>
								安全退出
							</a>
						</li>
					</ul>
				</li>
			</ul>
		</div>

	</div>
</div>
<!--主面板-->
<div class="main-container ace-save-state" id="main-container">
	<script type="text/javascript">
		try { ace.settings.loadState('main-container') } catch (e) { }
	</script>
	<!--全局设置-->
	<div class="ace-settings-container" id="ace-settings-container">
		<div class="btn btn-app btn-xs btn-warning ace-settings-btn" id="ace-settings-btn">
			<i class="ace-icon fa fa-cog bigger-130"></i>
		</div>

		<div class="ace-settings-box clearfix" id="ace-settings-box">
			<div class="pull-left width-100">
				<div class="ace-settings-item">
					<div class="pull-left">
						<select id="skin-colorpicker" class="hide">
							<option data-skin="no-skin" value="#438EB9">#438EB9</option>
							<option data-skin="skin-1" value="#222A2D">#222A2D</option>
							<option data-skin="skin-2" value="#C6487E">#C6487E</option>
							<option data-skin="skin-3" value="#D0D0D0">#D0D0D0</option>
						</select>
					</div>
					<span>&nbsp; 主题切换</span>
				</div>

				<div class="ace-settings-item">
					<input type="checkbox" class="ace ace-checkbox-2 ace-save-state" id="ace-settings-navbar" autocomplete="off" />
					<label class="lbl" for="ace-settings-navbar">头部固定</label>
				</div>

				<div class="ace-settings-item">
					<input type="checkbox" class="ace ace-checkbox-2 ace-save-state" id="ace-settings-sidebar" autocomplete="off" />
					<label class="lbl" for="ace-settings-sidebar"> 菜单固定</label>
				</div>

				<div class="ace-settings-item">
					<input type="checkbox" class="ace ace-checkbox-2 ace-save-state" id="ace-settings-breadcrumbs" autocomplete="off" />
					<label class="lbl" for="ace-settings-breadcrumbs">导航固定</label>
				</div>

				<div class="ace-settings-item">
					<input type="checkbox" class="ace ace-checkbox-2 ace-save-state" id="ace-settings-add-container" autocomplete="off" />
					<label class="lbl" for="ace-settings-add-container">
						3/4屏幕
					</label>
				</div>
				<div class="ace-settings-item">
					<input type="checkbox" class="ace ace-checkbox-2" id="ace-settings-rtl" autocomplete="off" />
					<label class="lbl" for="ace-settings-rtl">左右切换</label>
				</div>
				<div class="ace-settings-item">
					<input type="checkbox" class="ace ace-checkbox-2" id="ace-settings-hover" autocomplete="off" />
					<label class="lbl" for="ace-settings-hover"> Submenu on Hover</label>
				</div>

				<div class="ace-settings-item">
					<input type="checkbox" class="ace ace-checkbox-2" id="ace-settings-compact" autocomplete="off" />
					<label class="lbl" for="ace-settings-compact"> Compact Sidebar</label>
				</div>

				<div class="ace-settings-item">
					<input type="checkbox" class="ace ace-checkbox-2" id="ace-settings-highlight" autocomplete="off" />
					<label class="lbl" for="ace-settings-highlight"> Alt. Active Item</label>
				</div>
			</div><!-- /.pull-left -->

			
		</div><!-- /.ace-settings-box -->
	</div>
	<!--左侧菜单-->
	<div id="sidebar" class="sidebar responsive ace-save-state">
		<script type="text/javascript">
			try { ace.settings.loadState('sidebar') } catch (e) { }
		</script>
		<!-- /.sidebar-shortcuts -->
		<div class="sidebar-shortcuts" id="sidebar-shortcuts">
			<div class="sidebar-shortcuts-large" id="sidebar-shortcuts-large">
				<button class="btn btn-success">
					<i class="ace-icon fa fa-signal"></i>
				</button>

				<button class="btn btn-info">
					<i class="ace-icon fa fa-pencil"></i>
				</button>

				<button class="btn btn-warning">
					<i class="ace-icon fa fa-users"></i>
				</button>

				<button class="btn btn-danger btnRefresh" title="刷新活动页">
					<i class="ace-icon fa fa-refresh"></i>
				</button>
			</div>

			<div class="sidebar-shortcuts-mini" id="sidebar-shortcuts-mini">
				<span class="btn btn-success"></span>

				<span class="btn btn-info"></span>

				<span class="btn btn-warning"></span>

				<span class="btn btn-danger"></span>
			</div>
		</div>
		<!-- 菜单列表 -->
		<ul class="nav nav-list two-menu-all"></ul>

		<div class="sidebar-toggle sidebar-collapse" id="sidebar-collapse">
			<i id="sidebar-toggle-icon" class="ace-icon fa fa-angle-double-left ace-save-state" data-icon1="ace-icon fa fa-angle-double-left" data-icon2="ace-icon fa fa-angle-double-right"></i>
		</div>
	</div>
	<!--右侧内容-->
	<div class="main-content">
		<div class="col-xs-12" style="padding:0px 0px 0px 0px;">
			<div class="tabbable">
				<div class="breadcrumbs ace-save-state" id="breadcrumbs" style="border-bottom: 0px solid #E5E5E5;padding:0px;min-height:0px;">
					<ul class="nav nav-tabs" id="mainTab" style="padding-left:12px;padding-top:5px;">
						<li class="active">
							<a data-toggle="tab" href="#homePanel" aria-expanded="true">
								首页
								<i class="fa fa-remove nva-tab-remove" onclick="removeTab(this)"></i>

							</a>
						</li>
					</ul>
				</div>
				

				<div class="tab-content" id="mainTabContent" style="border:0px solid #000;">
					<div id="homePanel" class="tab-pane fade in active" first-url="/Main/Panel">

					</div>
				</div>
			</div>
		</div>

	</div>
	<!--尾部信息-->
	<!--
		<div class="footer">
		<div class="footer-inner">
			<div class="footer-content">
				<span class="bigger-120">
					<span class="blue bolder">Ace</span>
					Application &copy; 2013-2014
				</span>

				&nbsp; &nbsp;
				<span class="action-buttons">
					<a href="#">
						<i class="ace-icon fa fa-twitter-square light-blue bigger-150"></i>
					</a>

					<a href="#">
						<i class="ace-icon fa fa-facebook-square text-primary bigger-150"></i>
					</a>

					<a href="#">
						<i class="ace-icon fa fa-rss-square orange bigger-150"></i>
					</a>
				</span>
			</div>
		</div>
	</div>
	-->

	<a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
		<i class="ace-icon fa fa-angle-double-up icon-only bigger-110"></i>
	</a>
</div>


<script>

    $(function () {
        InitUI();
	
        ajaxGet("/Main/Panel", $("#homePanel"));
		loadTwoMenu("/Main/LeftPermissionMenuView");
        $(".first-menu").click(function () {
            $(".first-menu").removeClass("active");
            $(this).addClass("active");
			loadTwoMenu("/Main/LeftPermissionMenuView");
        });
    });

</script>